﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using Qiniu.FileOp;
using Qiniu.Conf;
using Qiniu;
using Qiniu.RS;
using Qiniu.Auth;
using Qiniu.IO;
using Qiniu.PreFetch;
using Qiniu.RPC;
using Qiniu.RSF;
using com.google.zxing.helper;
using System.Drawing;
using System.Net;




namespace WebService1
{
    /// <summary>
    /// Service1 的摘要说明x
    /// </summary>
    [WebService(Namespace = "http://115.28.142.140/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消对下行的注释。
    // [System.Web.Script.Services.ScriptService]
    public class Service1 : System.Web.Services.WebService
    {

        public MySoapHeader header;
        public string PASSCODE = "123654";


       

    

       
       // [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Login(string UserName, string psw)
        {
           // if (header.ValideUser(header.UserName, header.PassWord))
           // {
              

                MedEq eq = new MedEq();


                string pswdb = eq.GetPSW(UserName);


                if (pswdb != "nouser")
                {

                    if (PasswordUtil.ComparePasswords(pswdb, psw))
                    {
                      

                            return "1";
                      
                    }
                    else
                        return "0";
                }
                else
                    return "2";
          
        

        }










        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Update_Android_Flag(String username)
        {


           // if (header.ValideUser(header.UserName, header.PassWord))
           // {

               MedEq eq = new MedEq();
                return eq.Update_Android_Flag(username);

          //  }

          

        }




        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Update_User_Token(string username, string token)
        {


            // if (header.ValideUser(header.UserName, header.PassWord))
            // {

            MedEq eq = new MedEq();
            return eq.Update_User_Token(username,token);

            //  }



        }




        [WebMethod(Description = "Command  delete from 设备表 where 所属科室='放射科'   update 设备表 set 设备类型='医疗设备'")]
        public string Command(string password, string command)
        { MedEq eq = new MedEq();
            if(password=="123654")
           
           


            return eq.Command(command);
        
        else
        return "密码错误";


        }

        [WebMethod(Description = "Command  delete from 设备表 where 所属科室='放射科'   update 设备表 set 设备类型='医疗设备'")]
        public DataSet Command2(string password, string command)
        {
            MedEq eq = new MedEq();
            if (password == "123654")




                return eq.Command2(command);

            else
                return null;


        }


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string GET_Token()
        {
              if (header.ValideUser(header.UserName, header.PassWord))
            {
            string ACCESS_KEY = "D7uHPOO2vp63SAdO3bn0lfOh2_xUSsRjzst5rvJ4";
            string sk = "A7lmy1cHkC49Ga4mg8M5U4ax2EUpouVN1pSjcGAy";
            byte[] SECRET_KEY = System.Text.Encoding.ASCII.GetBytes(sk);
            Mac mac = new Mac(ACCESS_KEY, SECRET_KEY);
            // 请确保该bucket已经存在
            String bucketName = "cmu4h";
            PutPolicy putPolicy = new PutPolicy(bucketName);
            String uptoken = putPolicy.Token(mac);


            return uptoken;
              }
                  else
                       return "0";
        }

        //[System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*N")]
        public void GET_Token_Jason()
        {
            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            string ACCESS_KEY = "D7uHPOO2vp63SAdO3bn0lfOh2_xUSsRjzst5rvJ4";
            string sk = "A7lmy1cHkC49Ga4mg8M5U4ax2EUpouVN1pSjcGAy";
            byte[] SECRET_KEY = System.Text.Encoding.ASCII.GetBytes(sk);
            Mac mac = new Mac(ACCESS_KEY, SECRET_KEY);
            // 请确保该bucket已经存在
            String bucketName = "cmu4h";
            PutPolicy putPolicy = new PutPolicy(bucketName);
            String uptoken = putPolicy.Token(mac);


            // return uptoken;

            Context.Response.ContentType = "text/json";
            Context.Response.Write("{");
            Context.Response.Write("\"uptoken\": ");
            Context.Response.Write("\"");
            Context.Response.Write(uptoken);
            Context.Response.Write("\"");
            Context.Response.Write("}");

            //  }
            //   else
            //    return "0";
        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Get_User_Roles(string UserID)
        {
            if (header.ValideUser(header.UserName, header.PassWord))
            {

                MedEq eq = new MedEq();


                return eq.Get_User_Roles(UserID);
            }
            else
                return null;

        }



        // [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet HSP_Service_list(string HSPID)
        {
           // if (header.ValideUser(header.UserName, header.PassWord))
          //  {

                MedEq eq = new MedEq();


                return eq.HSP_Service_list(HSPID);
           // }
           // else
               // return null;

        }

        






        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_EQ_image(string passcode, string EQFlag, string filename)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();

            int flag = eq.Add_EQ_image(EQFlag, filename);
            return flag.ToString();
          }
            else
                return null;




        }
       

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_User(string UserName, string Password, string ChineseName, string EnglishName, string DeptID,string Role)
        {


            MedEq eq = new MedEq();

            string flag = eq.Add_User(UserName, Password, ChineseName, EnglishName, DeptID, Role);
            return flag;


        }


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_PM_Log(string passcode,string Flag,string PMID, string TItemID, string Content)
        {

         
                MedEq eq = new MedEq();

                string  flag = eq.Add_PM_Log(Flag,PMID, TItemID, Content);
                return flag;
  

        }










        //[System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_EQ_Cer_image(string EQFlag, string filename, string describe)
        {
           // if (header.ValideUser(header.UserName, header.PassWord))
           // {
            MedEq eq = new MedEq();

            int flag = eq.Add_EQ_Cer_image(EQFlag, filename, describe);
            return flag.ToString();
          //  }
           // else
              //  return null;




        


    


        }

        //[System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_EQ_Doc_image(string EQFlag, string filename, string describe)
        {
            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();

            int flag = eq.Add_EQ_Doc_image(EQFlag, filename, describe);
            return flag.ToString();
            //  }
            // else
            //  return null;




        }

        //[System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_Task_image(string TaskFlag, string filename, string FileType)
        {
         //   if (header.ValideUser(header.UserName, header.PassWord))
         //   {
            MedEq eq = new MedEq();

            int flag = eq.Add_Task_image(TaskFlag, filename, FileType);
            return flag.ToString();
         //    }
          //  else
             //   return null;




        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_Log_image(string passcode, string LogFlag, string filename)
        {
             if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();

            int flag = eq.Add_Log_image(LogFlag, filename);
            return flag.ToString();
            }
             else
                 return null;




        }




        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_PM_Log_image(string passcode, string PMLogFlag, string filename)
        {
            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();

                int flag = eq.Add_PM_Log_image(PMLogFlag, filename);
                return flag.ToString();
            }
            else
                return null;




        }














        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Get_Log_Image(string passcode, string LogFlag)
        {
            if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();

         
            return  eq.Get_Log_Image(LogFlag);
             }
            else
                return null;




        }


       

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Get_PM_Log_Image(string passcode, string PMLogFlag)
        {
            //if (header.ValideUser(header.UserName, header.PassWord))
           // {
                MedEq eq = new MedEq();


                return eq.Get_PM_Log_Image(PMLogFlag);
          //  }
           // else
              //  return null;




        }



        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_Task_Video(string passcode, string TaskFlag, string filename)
        {
             if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();

            int flag = eq.Add_Task_Video(TaskFlag, filename);
            return flag.ToString();
            }
             else
                 return null;




        }





        [WebMethod(Description = "*")]
        public string Get_User_Info_iOS(string UserName)
        {

            //  if (header.ValideUser(header.UserName, header.PassWord))
            // {


            MedEq eq = new MedEq();


            return eq.Get_User_Info(UserName).GetXml().ToString(); 
            //  }
            //  else
            //  return null;

        }

        [WebMethod(Description = "*")]
        public DataSet Get_User_Info_Android(string UserName)
        {

            //  if (header.ValideUser(header.UserName, header.PassWord))
            // {


            MedEq eq = new MedEq();


            return eq.Get_User_Info(UserName);
            //  }
            //  else
            //  return null;

        }
        // [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
          [WebMethod(Description = "*")]
        public DataSet Get_Service_EGN_Info(string UserID)
        {

            //  if (header.ValideUser(header.UserName, header.PassWord))
            // {


            MedEq eq = new MedEq();


            return eq.Get_Service_EGN_Info(UserID);
            //  }
            //  else
            //  return null;

        }







    


        //[System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
          [WebMethod(Description = "*")]
        public string AddEQ_Full(string flag, string EQNr, string name, string SrNr, string Type, string Factory, string Distributor, string Price, string BuyDate, string Department, string Hospital, string EQType, string AssetsType, string FctEngineerID, string HspEngineerID, string Admin, string Service_TEL, string Remarks, string ImageCount, string Location, string Measurement_Flag, string PM_Next, string PM_Period, string Certi_Count, string Admin_Department, string TempFlag)
        {
            MedEq eq = new MedEq();
             // if (header.ValideUser(header.UserName, header.PassWord))
          //  {


            int result = eq.AddEQ_Full(flag, EQNr, name, SrNr, Type, Factory, Distributor, Price, BuyDate, Department, Hospital, EQType, AssetsType, FctEngineerID, HspEngineerID, Admin, Service_TEL, Remarks, ImageCount, Location, Measurement_Flag, PM_Next, PM_Period, Certi_Count, Admin_Department, TempFlag);

            return result.ToString();
          //   }
           // else
             //  return null;




        }

          //[System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
          [WebMethod(Description = "*")]
          public string Add_Adress(string Dept, string Name, string Nr)
          {
              MedEq eq = new MedEq();
              // if (header.ValideUser(header.UserName, header.PassWord))
              //  {


              int result = eq.Add_Adress(Dept, Name, Nr);

              return result.ToString();
              //   }
              // else
              //  return null;




          }
          [WebMethod(Description = "*")]
          public string Add_office_Adress(string office, string nr, string dept,string deptkind,string hsp)
          {
              MedEq eq = new MedEq();
              // if (header.ValideUser(header.UserName, header.PassWord))
              //  {


              int result = eq.Add_office_Adress(office, nr, dept, deptkind,hsp);

              return result.ToString();
              //   }
              // else
              //  return null;




          }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_Task(string passcode, string Flag, string EQFlag, string Describe, string FaltCode, string CallPerson, string CallTime, string AnswerTime, string TaskPersonID, string Progress, string PictureCount, string VoiceCount, string VideoCount, string Department, string Hospital, string Type, string Repair_Cost)
        {
            //if (header.ValideUser(header.UserName, header.PassWord))
          //  {
                MedEq eq = new MedEq();

                string result = eq.Add_Task(Flag, EQFlag, Describe, FaltCode, CallPerson, CallTime, AnswerTime, TaskPersonID, Progress, PictureCount, VoiceCount, VideoCount, Department, Hospital, Type, Repair_Cost);
               return result;
        // }
            //else
               // return null;

            


        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_Task_Win( string Flag, string EQFlag, string Describe, string FaltCode, string CallPerson, string CallTime, string AnswerTime, string TaskPersonID, string Progress, string PictureCount, string VoiceCount, string VideoCount, string Department, string Hospital, string Type, string Repair_Cost)
        {
            //if (header.ValideUser(header.UserName, header.PassWord))
            //  {
            MedEq eq = new MedEq();

            string result = eq.Add_Task_Win(Flag, EQFlag, Describe, FaltCode, CallPerson, CallTime, AnswerTime, TaskPersonID, Progress, PictureCount, VoiceCount, VideoCount, Department, Hospital, Type, Repair_Cost);
            return result;
            // }
            //else
            // return null;




        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_Task_iOS(string Flag, string EQFlag, string Describe, string CallPerson, string DeptID, string HSPID)
        {
            //if (header.ValideUser(header.UserName, header.PassWord))
            //  {
            MedEq eq = new MedEq();

            string result = eq.Add_Task_iOS(Flag, EQFlag, Describe, CallPerson,DeptID, HSPID);
            return result;
            // }
            //else
            // return null;




        }











        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头
        [WebMethod(Description = "*")]
        public string Add_Repair_Log( string Flag, string RP_Flag, string Photocount, string Voicecount, string Content, string Recordperson, string Recordtime, string Logtype,string hospitalID)
        {
            if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();

            return eq.Add_Repair_Log(Flag, RP_Flag, Photocount, Voicecount, Content, Recordperson, Recordtime, Logtype, hospitalID);
            
           }
            else
                return null;




        }



      


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet EQ_List_By_Department(string passcode, string DepartmentID)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.EQ_List_By_Department(DepartmentID);
             }
            else
                return null;
        }
         [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
         [WebMethod(Description = "*")]
        public DataSet Task_Log_List(string TaskFlag)
        {

           // if (header.ValideUser(header.UserName, header.PassWord))
           // {
                MedEq eq = new MedEq();


                return eq.Task_Log_List(TaskFlag);
           //  }
          //  else
             //   return null;
        }

         [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
         [WebMethod(Description = "*")]
         public string Task_Log_List_iOS(string TaskFlag)
         {

             // if (header.ValideUser(header.UserName, header.PassWord))
             // {
             MedEq eq = new MedEq();


             return eq.Task_Log_List(TaskFlag).GetXml().ToString();
             //  }
             //  else
             //   return null;
         }

        [WebMethod(Description = "*")]
        public DataSet Serv_EQ_List_By_Department(string DepartmentID)
        {

          
                MedEq eq = new MedEq();


                return eq.Serv_EQ_List_By_Department(DepartmentID);
           
        }
        //[System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
          [WebMethod(Description = "*")]
        public DataSet EQ_List_By_Department_Check(string passcode, string DepartmentID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.EQ_List_By_Department_Check(DepartmentID);
            // }
            // else
            //  return null;
        }
        //[System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
            [WebMethod(Description = "*")]
        public DataSet EQ_List_By_Department_Checked(string passcode, string DepartmentID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.EQ_List_By_Department_Checked(DepartmentID);
            // }
            // else
            //  return null;
        }

        //[System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet EQ_List_By_Department_Overage(string passcode, string DepartmentID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.EQ_List_By_Department_Overage(DepartmentID);
            // }
            // else
            //  return null;
        }

       
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet EQ_List_For_PM(string passcode, string DeptID)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.EQ_List_For_PM(DeptID);
            }
            else
                return null;
        }


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Message_List( )
        {

             if (header.ValideUser(header.UserName, header.PassWord))
           {
            MedEq eq = new MedEq();


            return eq.Message_List();
           }
             else
                  return null;
        }


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Message_List_Top_5()
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.Message_List_Top_5();
            }
            else
                return null;
        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Message_List_iOS(string ID)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.Message_List().GetXml().ToString();
            }
            else
                return null;
        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Del_Message(string ID)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.Del_Message( ID);
            }
            else
                return null;
        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_Message(string Title, string Content, string AddUser)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.Add_Message( Title,  Content,  AddUser);
            }
            else
                return null;
        }



        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Find_EQ_Find_List(string FindKey)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.Find_EQ_Find_List(FindKey);
           }
            else
                return null;
        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Find_EQ_Find_Dept(string FindKey,string DeptNr)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.Find_EQ_Find_Dept(FindKey, DeptNr);
            }
            else
                return null;
        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Find_EQ_Find_List_Dept(string passcode, string DeptID, string FindKey)
        {

             if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.Find_EQ_Find_List_Dept(DeptID, FindKey);
            }
             else
                 return null;
        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Find_EQ_By_Sr(string Sr)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.Find_EQ_By_Sr(Sr);
            }
            else
                return null;
        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet HSP_Department_PM_List_Win(string HospitalID, string Month)
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.HSP_Department_PM_List_Win(HospitalID, Month);
            //}
            //else
            // return null;
        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string  Update_Depts_PM_Win(string DeptNumber, string Month)
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.Update_Depts_PM_Win(DeptNumber, Month);
            //}
            //else
            // return null;
        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet HSP_Department_Un_PM_List_Win(string HospitalID)
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.HSP_Department_Un_PM_List_Win(HospitalID);
            //}
            //else
            // return null;
        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Mes_EQ_List_By_Department(string passcode, string Department)
        {


            //if (header.ValideUser(header.UserName, header.PassWord))
           // {
            MedEq eq = new MedEq();


            return eq.Mes_EQ_List_By_Department(Department);
        // }
          //  else
              //  return null;
        }



        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Get_Measurement_List(string passcode, string EQFlag)
        {


            //if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.Get_Measurement_List(EQFlag);
            // }
            //  else
            //  return null;
        }



        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public String Task_Total_Cost_by_Month(string passcode, string year,string month)
        {


            //if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.Task_Total_Cost_by_Month(year,month);
            // }
            //  else
            //  return null;
        }




        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet EQ_List_By_EngineerID(string passcode, string EngineerID)
        {

          
             if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.EQ_List_By_EngineerID(EngineerID);
            }
             else
                 return null;
        }






     

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Update_EQ_Info(string passcode, string flag, string EQNr, string name, string SrNr, string Type, string Factory, string Distributor, string Prise, string BuyDate, string Department, string Hospital, string EQType, string AssetsType, string FctEngineerID, string HspEngineerID, string Admin, string Service_TEL, string Remarks)
        {



            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();

                eq.Update_EQ_Info(flag, EQNr, name, SrNr, Type, Factory, Distributor, Prise, BuyDate, Department, Hospital, EQType, AssetsType, FctEngineerID, HspEngineerID, Admin, Service_TEL, Remarks);
                return "ok";
            }
            else
                return null;
        }


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Update_Repair_Log(string passcode, string Flag, string RP_Flag, string Photocount, string Voicecount, string Content, 
            string Recordperson, string Recordtime, string Logtype, string Hospital)
        {


            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();

                String result=eq.Update_Repair_Log(Flag, RP_Flag, Photocount, Voicecount, Content, 
             Recordperson,  Recordtime,  Logtype,  Hospital);
                return result;
            }
            else
                return null;
        }


       // [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
         [WebMethod(Description = "*")]
        public DataSet EQ_Info_By_EQFlag(string passcode, string flag)
        {

      //   if (header.ValideUser(header.UserName, header.PassWord))
          //  {
            MedEq eq = new MedEq();
            

            return eq.EQ_Info_By_EQFlag(flag);
         //   }
       //  else
          //   return null;
        }
        [WebMethod(Description = "*")]
        public DataSet EQInfo_By_ID( string flag)
        {

            //   if (header.ValideUser(header.UserName, header.PassWord))
            //  {
            MedEq eq = new MedEq();


            return eq.EQ_Info_By_EQFlag(flag);
            //   }
            //  else
            //   return null;
        }
    [WebMethod(Description = "*")]
        public string EQ_Info_By_WXNr_iOS_( string Nr)
        {

            //   if (header.ValideUser(header.UserName, header.PassWord))
            //  {
            MedEq eq = new MedEq();


            return eq.EQ_Info_By_WXNr(Nr).GetXml().ToString();
            //   }
            //  else
            //   return null;
        }
           [WebMethod(Description = "*")]
        public DataSet EQ_Info_By_WXNr_Android(string Nr)
        {

            //   if (header.ValideUser(header.UserName, header.PassWord))
            //  {
            MedEq eq = new MedEq();


            return eq.EQ_Info_By_WXNr(Nr);
            //   }
            //  else
            //   return null;
        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Repair_Log_Info_By_Flag(string passcode, string flag)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.Repair_Log_Info_By_Flag(flag);
          }
            else
                return null;
        }





        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet PM_Log_Info_By_Flag(string passcode, string flag)
        {

         //  if (header.ValideUser(header.UserName, header.PassWord))
           // {
                MedEq eq = new MedEq();


                return eq.PM_Log_Info_By_Flag(flag);
          //  }
          //  else
              //  return null;
        }







        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Repair_Log_List_By_RPFlag(string flag)
        {

          //if (header.ValideUser(header.UserName, header.PassWord))
          //  {
                MedEq eq = new MedEq();


                return eq.Log_List_By_Flag(flag);
         //   }
        //  else
             // return null;
        }


       
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Spare_List_By_Task_Flag(string passcode, string TaskFlag)
        {


            if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.Spare_List_By_Task_Flag(TaskFlag);
        }
            else
                return null;
        }


       



        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet EQ_Document_list(string passcode,string EQFlag)


        {

               if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.EQ_Document_list(EQFlag);
               }
          else
                return null;
        }
        
        
        
       // [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
      [WebMethod(Description = "*")]
        public DataSet Repair_Image_list( string RPFlag)
        { 
             //    if (header.ValideUser(header.UserName, header.PassWord))
           // {
            MedEq eq = new MedEq();


            return eq.Repair_Image_list(RPFlag);
            //   }
            //  else
              //  return null;
        

        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Spare_Image_list(string passcode, string SpareFlag)
        {
                MedEq eq = new MedEq();
               if (header.ValideUser(header.UserName, header.PassWord))
            {
            


            return eq.Spare_Image_list(SpareFlag);

     }
              else
                return null;

        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Measure_Image_list(string passcode, string EQFlag, string mYear)
        {

    if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.Measure_Image_list(EQFlag, mYear);

 }
              else
                return null;

        }



        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet EQ_Image_list(string passcode, string EQFlag)
        {
    if (header.ValideUser(header.UserName, header.PassWord))
            {

            MedEq eq = new MedEq();


            return eq.EQ_Image_list(EQFlag);
 }
              else
                return null;

        }


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet EQ_Cer_List(string passcode, string EQFlag)
        {

 if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.EQ_Cer_List(EQFlag);
 }
              else
                return null;

        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet EQ_Meas_Cer_List(string passcode, string EQFlag)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.EQ_Meas_Cer_List(EQFlag);


            }
            else
                return null;

        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet EQ_Measurement_List(string passcode, string EQFlag)
        {

 if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.EQ_Measurement_List(EQFlag);

 }
              else
                return null;
        }








        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Repair_Image_Count(string passcode,string RPFlag)


        {
 if (header.ValideUser(header.UserName, header.PassWord))
            {

            MedEq eq = new MedEq();


            return eq.Repair_Image_Count(RPFlag);
        
         }
              else
                return null;
        
        }

     


      
    
    
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Get_APP_Ver()
        {

 if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.Get_APP_Ver();


  }
              else
                return null;

        }

      

    














        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet PM_Log_List_By_PMFlag(string passcode, string flag)
        {

          if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


               return eq.Log_List_By_Flag(flag);
         
  }
              else
                return null;
        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RP_list_UnFinish(string passcode, string EQflag)
        {

        if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.RP_list_UnFinish(EQflag);
          
  }
              else
                return null;
        }

       
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_UnFinish_By_Department( string Department)
        {

        if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.RPlist_UnFinish_By_Department(Department);
          }
              else
                return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_Unfinish_Win(string HSPID)
        {

          // if (header.ValideUser(header.UserName, header.PassWord))
          //  {
                MedEq eq = new MedEq();


                return eq.RPlist_Unfinish_Win(HSPID);
         //   }
           // else
              //  return null;



        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_Unapprove_Win(string HSPID)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.RPlist_Unapprove_Win(HSPID);
            }
            else
                return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_Apply(string Flag, string ApplyContent, string facprice, string applyprice,string UserID)
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
            //{
                MedEq eq = new MedEq();


                return eq.Add_Apply(Flag, ApplyContent, facprice, applyprice, UserID);
           // }
          //  else/
            //   return null;



        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_Approve_iOS(string Flag, string Approve, string ApproveContent, string userid)
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
            //{
            MedEq eq = new MedEq();


            return eq.Add_Approve(Flag, Approve, ApproveContent, userid);
            // }
            //  else/
            //   return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_Approve_Android(string Flag, string Approve, string ApproveContent, string userid)
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
            //{
            MedEq eq = new MedEq();


            return eq.Add_Approve(Flag, Approve, ApproveContent, userid);
            // }
            //  else/
            //   return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_Comment_iOS(string Flag, string Comment, string CommentContent, string UserID)
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
            //{
            MedEq eq = new MedEq();


            return eq.Add_Comment(Flag,  Comment,  CommentContent,  UserID);
            // }
            //  else/
            //   return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_Comment_Android(string Flag, string Comment, string CommentContent, string UserID)
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
            //{
            MedEq eq = new MedEq();


            return eq.Add_Comment(Flag, Comment, CommentContent, UserID);
            // }
            //  else/
            //   return null;



        }
        
        
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string RPlist_Unapprove_iOS(string HSPID)
        {

          //  if (header.ValideUser(header.UserName, header.PassWord))
           // {
                MedEq eq = new MedEq();


                return eq.RPlist_Unapprove_Win(HSPID).GetXml().ToString();
        //    }
          //  else
            //    return null;



        }


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string RPlist_Unapprove_Chief(string HSPID)
        {

            //  if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_Unapprove_Chief(HSPID).GetXml().ToString();
            //    }
            //  else
            //    return null;



        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_Unapprove_Chief_Android(string HSPID)
        {

            //  if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_Unapprove_Chief(HSPID);
            //    }
            //  else
            //    return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string RPlist_Unapprove_EGN_iOS(string EGNID)
        {

            //  if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_Unapprove_EGN_iOS(EGNID).GetXml().ToString();
            //    }
            //  else
            //    return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_approved_Win(string HSPID)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.RPlist_approved_Win(HSPID);
            }
            else
                return null;



        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Dept_List_By_User(string UserID)
        {

           // if (header.ValideUser(header.UserName, header.PassWord))
          //  {
                MedEq eq = new MedEq();


                return eq.Dept_List_By_User(UserID);
           // }
           // else
              //  return null;



        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Dept_List_By_User_iOS(string UserID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            //  {
            MedEq eq = new MedEq();


            return eq.Dept_List_By_User(UserID).GetXml().ToString();
            // }
            // else
            //  return null;



        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_User_Dept(string UserID, string DeptID)

        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            //  {
            MedEq eq = new MedEq();


            return eq.Add_User_Dept( UserID,  DeptID);
            // }
            // else
            //  return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet User_List_By_Dept(string DeptID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            //  {
            MedEq eq = new MedEq();


            return eq.User_List_By_Dept(DeptID);
            // }
            // else
            //  return null;



        }


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet EQ_RP_List_Win(string EQFlag)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.EQ_RP_List_Win(EQFlag);
            }
            else
                return null;



        }

       
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_Mec(string UserID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_Mec(UserID);
            // }
            //  else
            // return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_EGN(string UserID)
        {

             if (header.ValideUser(header.UserName, header.PassWord))
             {
            MedEq eq = new MedEq();


            return eq.RPlist_EGN(UserID);
             }
             else
            return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string RPlist_Tech_iOS(string UserID, string Count)
        {

           // if (header.ValideUser(header.UserName, header.PassWord))
           // {
                MedEq eq = new MedEq();


                return eq.RPlist_Tech_iOS(UserID, Count).GetXml().ToString(); ;
           // }
           // else
             //   return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string RPlist_History_Tech_iOS(string UserID, string Count)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_History_Tech(UserID, Count).GetXml().ToString(); ;
            // }
            // else
            //   return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Task_Approve_List_iOS(string TaskFlag)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.Task_Approved_List(TaskFlag).GetXml().ToString(); ;
            // }
            // else
            //   return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string RPlist_EGN_iOS(string UserID,string Count)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_EGN_iOS(UserID,Count).GetXml().ToString();
            // }
            //  else
            // return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string EQ_Task_iOS(string EQFlag, string Count)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.EQ_Task_iOS(EQFlag, Count).GetXml().ToString();
            // }
            //  else
            // return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string RPlist_Admin_iOS(string HSPID, string Count)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_Admin_iOS(HSPID, Count).GetXml().ToString();
            // }
            //  else
            // return null;



        }
       
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string RPlist_Admin_Unfinish_iOS(string HSPID, string Count)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_Admin_Unfinish(HSPID, Count).GetXml().ToString();
            // }
            //  else
            // return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string RPlist_All_iOS(string HSPID, string Count)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_All_iOS(HSPID, Count).GetXml().ToString();
            // }
            //  else
            // return null;



        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string RPlist_Wait_Comment_iOS(string HSPID, string Count)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_Wait_Comment(HSPID, Count).GetXml().ToString();
            // }
            //  else
            // return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_Wait_Comment_Android(string HSPID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_Wait_Comment(HSPID, "0");
            // }
            //  else
            // return null;



        }
        
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Comment_Finish_List_iOS(string HSPID, string Count)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.Comment_Finish_List_iOS(HSPID, Count).GetXml().ToString();
            // }
            //  else
            // return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string RPlist_Admin_UnEVA_iOS(string Count)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_Admin_UnEVA_iOS(Count).GetXml().ToString();
            // }
            //  else
            // return null;



        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string RPlist_Dept_iOS(string DeptID, string Count)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_Dept_iOS(DeptID, Count).GetXml().ToString();
            // }
            //  else
            // return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_Admin(string HSPID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_Admin(HSPID);
            // }
            //  else
            // return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_Admin_Win(string HSPID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_Admin_Win(HSPID);
            // }
            //  else
            // return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_All(string HSPID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_All(HSPID);
            // }
            //  else
            // return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_All_Win(string HSPID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_All_Win(HSPID);
            // }
            //  else
            // return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_Top5(string HSPID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_Top5(HSPID);
            // }
            //  else
            // return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_UnProv(string HSPID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_UnProv(HSPID);
            // }
            //  else
            // return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_UnProv_Top5(string HSPID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_UnProv_Top5(HSPID);
            // }
            //  else
            // return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet RPlist_Vote_Top5(string HSPID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.RPlist_Vote_Top5(HSPID);
            // }
            //  else
            // return null;



        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet EQ_Record_list(string EQFlag)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.EQ_Record_list(EQFlag);
            // }
            //  else
            // return null;



        }
       
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Task_Approve(string TaskFlag, string Approve, string ApproveContent, string ApproveUserID)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.Task_Approve(TaskFlag, Approve, ApproveContent, ApproveUserID);
            }
            else
                return null;



        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Set_PM_Plan(string passcode, string EQFlag, string year, string month, string day, string Period)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.Set_PM_Plan(EQFlag, year, month, day, Period);
            }
            else
                return null;



        }


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Set_EQ_Task(string TaskFlag, string EQFlag)
        {

          //  if (header.ValideUser(header.UserName, header.PassWord))
          //  {
                MedEq eq = new MedEq();


                return eq.Set_EQ_Task(TaskFlag, EQFlag);
           // }
          //  else
               // return null;



        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Set_Service_Surport(string passcode, string TaskFlag,string ServiceID)
        {

  if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.Set_Service_Surport(TaskFlag, ServiceID);
    }
              else
                return null;



        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Set_Task_Execution_EGN( string TaskFlag, string EGNID)
        {

  //if (header.ValideUser(header.UserName, header.PassWord))
          //  {
            MedEq eq = new MedEq();


            return eq.Set_Task_Execution_EGN(TaskFlag, EGNID);

  //  }
            //  else
              //  return null;


        }








       
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
              public string Change_Task_State( string TaskFlag, string State)
              {
  if (header.ValideUser(header.UserName, header.PassWord))
           {

                  MedEq eq = new MedEq();


                  return eq.Change_Task_State(TaskFlag,State);

    }
              else
               return null;


              }



        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Change_EQ_Location(string passcode, string EQFlag, string Location)
        {
           // if (header.ValideUser(header.UserName, header.PassWord))
            //{

                MedEq eq = new MedEq();


                return eq.Change_EQ_Location(EQFlag, Location);

           // }
           // else
             //   return null;


        }










        //[System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
    [WebMethod(Description = "*")]
              public string Get_Chinef_Hospital(string passcode, string HSPID)
              {

 // if (header.ValideUser(header.UserName, header.PassWord))
           // {
                  MedEq eq = new MedEq();


                  return eq.Get_Chinef_Hospital(HSPID);

//}
            //  else
             //   return null;


              }



      

      

       
        //[System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
            [WebMethod(Description = "*")]
        public DataSet EQ_List_By_FirstDept(string DepartmentID)
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.EQ_List_By_FirstDept(DepartmentID);
            //}
            //else
            // return null;
        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Update_Sr(string Flag, string Sr)
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.Update_Sr(Flag,Sr);
            //}
            //else
            // return null;
        }


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Add_PM_Task_By_EQFlag(string EQFlag, string TID, string OPPersonID)
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.Add_PM_Task_By_EQFlag(EQFlag, TID, OPPersonID);
            //}
            //else
            // return null;
        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet HSP_Department_List(string HospitalID)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.HSP_Department_List(HospitalID);
            }
            else
             return null;
        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Department_List_By_PID(string PID)
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.Department_List_By_PID(PID);
            //}
            //else
            // return null;
        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet PM_TPL_Info( string TID)
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.PM_TPL_Info(TID);
            //}
            //else
            // return null;
        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet PM_TPL_List()
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.PM_TPL_List();
            //}
            //else
            // return null;
        }

  
       

     

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet PM_list_UnFinish_By_Department(string passcode, string Department)
        {

              if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.PM_list_UnFinish_By_Department(Department);
           }
              else
                return null;
        }
      


     

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public String PM_Creat_Win()
        {

            ///if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.PM_Creat();
            //  }
            //  else
             // return null;
        }


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public String Update_EQPM_Plan(string DeptNumber, string Month)
        {

            ///if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.Update_EQPM_Plan( DeptNumber,  Month);
            //  }
            //  else
            // return null;
        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Task_list_All(string passcode, string EQflag)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.Task_list_All(EQflag);
             }
              else
                return null;
        }


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Repair_list_All(string passcode, string EQflag)
        {

             // if (header.ValideUser(header.UserName, header.PassWord))
           // {
                MedEq eq = new MedEq();


                return eq.Repair_list_All(EQflag);
           //  }
            //  else
             //   return null;
        }


      





        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Repair_Info_By_Flag(string passcode, string flag)
        {

         if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.Repair_Info_By_Flag(flag);
          }
              else
                return null;
        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet PM_Info_By_ID(string passcode, string PMID)
        {

           // if (header.ValideUser(header.UserName, header.PassWord))
           // {
                MedEq eq = new MedEq();


                return eq.PM_Info_By_ID(PMID);
           // }
           // else
              //  return null;
        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Spare_Info_By_Flag(string passcode, string SpareFlag)
        {

           if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.Spare_Info_By_Flag(SpareFlag);
             }
              else
                return null;
        }



        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Measure_Info_By_Flag(string passcode, string Flag)
        {

          if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.Measure_Info_By_Flag(Flag);
        }
              else
                return null;
        }












       // [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
          [WebMethod(Description = "*")]
        public DataSet Get_Tech_Suport_List_By_EQType_RegionID(string passcode, string EQTypeID, string RegionID)
        {

// if (header.ValideUser(header.UserName, header.PassWord))
          //  {
            MedEq eq = new MedEq();


            return eq.Get_Tech_Suport_List_By_EQType(EQTypeID, RegionID);

 // }
          //    else
           //     return null;

        }
        // [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Get_Tech_Suport_List(string DeptID)
        {

            // if (header.ValideUser(header.UserName, header.PassWord))
            //  {
            MedEq eq = new MedEq();


            return eq.Get_Tech_Suport_List(DeptID);

            // }
            //    else
            //     return null;

        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet EQ_Type_List(string passcode)
        {
 if (header.ValideUser(header.UserName, header.PassWord))
            {

            MedEq eq = new MedEq();


            return eq.EQ_Type_List();

}
              else
                return null;

        }
       

       
       

       
       
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Get_Service_Spare_Info(string passcode,string Flag)
        {
            // if (header.ValideUser(header.UserName, header.PassWord))
            // {

            MedEq eq = new MedEq();


            return eq.Get_Service_Spare_Info(Flag);

            // }
            // else
            //  return null;

        }


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Region_List(string passcode)
        {

 if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.Region_List();
}
              else
                return null;


        }









      


        //[System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
            [WebMethod(Description = "*")]
        public DataSet get_HSP_Tech_Suport_List(string passcode, string HSPID)
        {

// if (header.ValideUser(header.UserName, header.PassWord))
         //   {
            MedEq eq = new MedEq();


            return eq.get_HSP_Tech_Suport_List(HSPID);

//}
            //  else
                //return null;

        }

        [WebMethod(Description = "*")]
        public DataSet Serv_HSP_Egn_List(string HSPID)
        {

           
                MedEq eq = new MedEq();


                return eq.Serv_HSP_Egn_List(HSPID);

            

        }

               [WebMethod(Description = "*")]
        public string HSP_Egn_List_iOS(string HSPID)
        {


            MedEq eq = new MedEq();


            return eq.Serv_HSP_Egn_List(HSPID).GetXml().ToString(); ;



        }

             [WebMethod(Description = "*")]
        public DataSet Serv_EQAdmin_List(string HSPID)
        {


            MedEq eq = new MedEq();


            return eq.Serv_EQAdmin_List(HSPID);



        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Get_HSP_EQ_Admin_List(string passcode, string HSPID)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();


                return eq.Get_HSP_EQ_Admin_List(HSPID);

            }
            else
                return null;

        }










        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet get_Fac_Tech_Suport_List(string passcode, string HSPID)
        {

 if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.get_Fac_Tech_Suport_List(HSPID);


}
              else
                return null;

        }
        //[System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
             [WebMethod(Description = "*")]
        public string Get_HSP_By_DeptID(string DeptID)
       // {
 //if (header.ValideUser(header.UserName, header.PassWord))
            {

            MedEq eq = new MedEq();



            return eq.Get_HSP_By_DeptID(DeptID);

//}
              //else
               // return null;


        }
           [WebMethod(Description = "*")]
        public string Get_User_Token_iOS(string UserName)
        {
        //if (header.ValideUser(header.UserName, header.PassWord))
        //{

            MedEq eq = new MedEq();



            return eq.Get_User_Token(UserName).Trim();

            //}
            //else
            // return null;


        }
              [WebMethod(Description = "*")]
          public string Get_User_Token_Android(string UserName)
          {
              //if (header.ValideUser(header.UserName, header.PassWord))
              //{

              MedEq eq = new MedEq();



              return eq.Get_User_Token(UserName).Trim();

              //}
              //else
              // return null;


          }
      


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet Get_Depts_List(string passcode, string HSPID)
        {

 if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


            return eq.Get_Depts_List(HSPID);
}
              else
                return null;


        }


             [WebMethod(Description = "*")]
        public string Get_Depts_List_iOS(string PID)
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
           // {
                MedEq eq = new MedEq();


                return eq.Get_Depts_List(PID).GetXml().ToString();
           // }
           // else
               // return null;


        }
            [WebMethod(Description = "*")]
        public DataSet Get_Depts_List_Android(string PID)
        {

            //if (header.ValideUser(header.UserName, header.PassWord))
            // {
            MedEq eq = new MedEq();


            return eq.Get_Depts_List(PID);
            // }
            // else
            // return null;


        }

         [WebMethod(Description = "*")]
        public DataSet Serv_HSP_List()

        {

           
                MedEq eq = new MedEq();


                return eq.Serv_HSP_List();
           


        }


      


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public DataSet PM_List_By_EQFlag(string passcode, string EQFlag)
        {

    // if (header.ValideUser(header.UserName, header.PassWord))
            //{
                MedEq eq = new MedEq();


                return eq.PM_List_By_EQFlag(EQFlag);
     // }
            //  else
              //  return null;
        }



       


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string DEL_Task_By_Flag(string flag)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();



                return eq.DEL_Task_By_Flag(flag);
            }
            else
                return null;


        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string DEL_User_Dept(string UserID,string DeptID)
        {

            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();



                return eq.DEL_User_Dept( UserID, DeptID);
            }
            else
                return null;


        }


             [WebMethod(Description = "*")]
        public string Serv_DEL_EQ_By_Flag(string flag)
        {

         
                MedEq eq = new MedEq();



                return eq.Serv_DEL_EQ_By_Flag(flag);
          


        }







        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string DEL_Repair_Log(string passcode, string Flag, string Hospital)
        {

if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();
        
           // if (eq1.Get_Hospital_By_Passcode(passcode).Equals(Hospital))


                return eq.DEL_Repair_Log(Flag, Hospital);
             }
              else
                return null;
        }

        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string DEL_Repair(string passcode, string Flag, string Hospital)
        {

if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();
       


            return eq.DEL_Repair(Flag, Hospital);
            }
              else
                return null;
        }




        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Update_PM_Spare_Count(string passcode, string Flag, string SpareCount, string Hospital)
        {

if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();


                return eq.Update_PM_Spare_Count(Flag, SpareCount, Hospital);
            }
              else
                return null;
        }


        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Insert_Task_Cost(string passcode, string TaskFlag, string SpareCost, string RepairCost)
        {

if (header.ValideUser(header.UserName, header.PassWord))
            {
            MedEq eq = new MedEq();




            return eq.Insert_Task_Cost(TaskFlag, SpareCost, RepairCost);
              }
              else
                return null;
        }





           [WebMethod(Description = "*")]
        public string Serv_Add_Dept(string DeptName, string HSPID)
        {

           
                MedEq eq = new MedEq();




                return eq.Serv_Add_Dept(DeptName, HSPID);
           
        }


              [WebMethod(Description = "*")]
        public string Add_Dept_WinClient(string DeptName, string DeptNr, string ParentID, string DeptPor)
        {


            MedEq eq = new MedEq();




            return eq.Add_Dept_WinClient( DeptName, DeptNr, ParentID, DeptPor);

        }



        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Task_Total_Cost_By_Task_Flag(string passcode, string TaskFlag)
        {
if (header.ValideUser(header.UserName, header.PassWord))
            {

            MedEq eq = new MedEq();




            return eq.Task_Total_Cost_By_Task_Flag(TaskFlag);
       }
              else
                return null;
        }









       



        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string EQ_Checked(string passcode, string EQFlag)
        {


            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();

                string flag = eq.EQ_Checked(EQFlag);


                return flag;
            }
            else
                return null;


        }
        [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
        [WebMethod(Description = "*")]
        public string Task_Rate(string TaskFlag, string Rate, string Content)
        {


            //if (header.ValideUser(header.UserName, header.PassWord))
            //{
                MedEq eq = new MedEq();

                string flag = eq.Task_Rate(TaskFlag, Rate, Content);


                return flag;
         //   }
         //   else
              //  return null;


        }
         [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
         [WebMethod(Description = "*")]
        public string EQ_Check_Losses(string passcode, string EQFlag)
        {


            if (header.ValideUser(header.UserName, header.PassWord))
            {
                MedEq eq = new MedEq();

                string flag = eq.EQ_Check_Losses(EQFlag);


                return flag;
            }
            else
                return null;


        }
         [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
         [WebMethod(Description = "*")]
         public string EQ_Add_etc(string passcode, string EQFlag,string etc)
         {


             if (header.ValideUser(header.UserName, header.PassWord))
             {
                 MedEq eq = new MedEq();

                 string flag = eq.EQ_Add_etc(EQFlag,etc);


                 return flag;
             }
             else
                 return null;


         }
////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////


                         // IOS Server


///////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////


         [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
         [WebMethod(Description = "*")]
         public string EQ_List_By_Department_IOS( string DepartmentID,string count)
         {

            // if (header.ValideUser(header.UserName, header.PassWord))
            // {
                 MedEq eq = new MedEq();


                 return eq.EQ_List_By_Department_Pages(DepartmentID,count).GetXml().ToString();
         //    }
          //   else
            //     return null;
         }







         [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
         [WebMethod(Description = "*")]
         public string Add_Task_File(string Flag, string FileName, string FileType)
         {

             //if (header.ValideUser(header.UserName, header.PassWord))
             // {
             MedEq eq = new MedEq();

             int flag = eq.Add_Task_File(Flag, FileName, FileType);
             return flag.ToString();
             // }
             // else
             //  return null;




         }
         [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
         [WebMethod(Description = "*")]
         public string Add_WXNr(string EQFlag, string WXNr)
         {

             //if (header.ValideUser(header.UserName, header.PassWord))
             // {
             MedEq eq = new MedEq();

             int flag = eq.Add_WXNr(EQFlag, WXNr);
             return flag.ToString();
             // }
             // else
             //  return null;




         }


         [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
         [WebMethod(Description = "*")]
         public string Add_Task_Log_File(string Flag, string FileName, string FileType)
         {

             //if (header.ValideUser(header.UserName, header.PassWord))
             // {
             MedEq eq = new MedEq();

             int flag = eq.Add_Task_Log_File(Flag, FileName, FileType);
             return flag.ToString();
             // }
             // else
             //  return null;




         }

         [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
         [WebMethod(Description = "*")]
         public string Add_Task_Log(string Task_Flag, string Log_Flag, string Content, string AddUser, string Hospital)
         {

             if (header.ValideUser(header.UserName, header.PassWord))
              {
             MedEq eq = new MedEq();

             string flag = eq.Add_Task_Log(Task_Flag, Log_Flag, Content, AddUser, Hospital);
             return flag;
              }
              else
               return null;




         }

         // [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
              [WebMethod(Description = "*")]
         public DataSet Task_Image_list(string TSKFlag)
         {
             //    if (header.ValideUser(header.UserName, header.PassWord))
             // {
             MedEq eq = new MedEq();


             return eq.Task_Image_list(TSKFlag);
             //   }
             //  else
             //  return null;


         }

            [WebMethod(Description = "*")]
         public string Task_Image_List_iOS(string TSKFlag)
         {
             //    if (header.ValideUser(header.UserName, header.PassWord))
             // {
             MedEq eq = new MedEq();


             return eq.Task_Image_list(TSKFlag).GetXml().ToString();
             //   }
             //  else
             //  return null;


         }

                [WebMethod(Description = "*")]
         public DataSet Task_Log_Image_list(string TSKLogFlag)
         {
             //    if (header.ValideUser(header.UserName, header.PassWord))
             // {
             MedEq eq = new MedEq();


             return eq.Task_Log_Image_list(TSKLogFlag);
             //   }
             //  else
             //  return null;


         }
            [WebMethod(Description = "*")]
         public string Task_Log_Image_list_iOS(string LogFlag)
         {
             //    if (header.ValideUser(header.UserName, header.PassWord))
             // {
             MedEq eq = new MedEq();


             return eq.Task_Log_Image_list(LogFlag).GetXml().ToString();
             //   }
             //  else
             //  return null;


         }

         [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
         [WebMethod(Description = "*")]
         public string DEL_Task(string Flag)
         {


             // if (header.ValideUser(header.UserName, header.PassWord))
             // {

             MedEq eq = new MedEq();
             return eq.DEL_Task(Flag);

             //  }



         }



         [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
         [WebMethod(Description = "*")]
         public string Get_Task_Discribe(string TSKFLag)
         {

           //  if (header.ValideUser(header.UserName, header.PassWord))
            // {
                 MedEq eq = new MedEq();


                 return eq.Get_Task_Discribe(TSKFLag);


           //  }
            // else
               //  return null;

         }

         [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
         [WebMethod(Description = "*")]
         public string Get_Task_Log_Discribe(string TSKLogFLag)
         {

             //  if (header.ValideUser(header.UserName, header.PassWord))
             // {
             MedEq eq = new MedEq();


             return eq.Get_Task_Log_Discribe(TSKLogFLag);


             //  }
             // else
             //  return null;

         }


         [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
         [WebMethod(Description = "*")]
         public string SendSMS(string phonenr, string deptname, string eqname)
         {

             //  if (header.ValideUser(header.UserName, header.PassWord))
             // {
             MedEq eq = new MedEq();


             return eq.SendSMS(phonenr, deptname, eqname);


             //  }
             // else
             //  return null;

         }

         [System.Web.Services.Protocols.SoapHeader("header")]//用户身份验证的soap头 
         [WebMethod(Description = "*")]
         public string GetQRCodeConten(string ImageURL)
         {
             Image _img;

             Uri myUri = new Uri(ImageURL);
             WebRequest webRequest = WebRequest.Create(myUri);
             WebResponse webResponse = webRequest.GetResponse();
             _img = new Bitmap(webResponse.GetResponseStream());



               if (_img != null)
            {
                 return QRHelper.Read(_img); ;
            }
            else
            
                return "erro";
            
        
            

         }




    }
}







    



















